package org.dromara.patrol.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import org.apache.dubbo.config.annotation.DubboReference;
import org.dromara.common.core.domain.R;
import org.dromara.system.api.RemoteUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author samuel
 * @date 2024-04-02 08:29:33
 */
@RestController
@SaIgnore
@RequestMapping("/test")
public class TestController {

    @DubboReference
    private RemoteUserService remoteUserService;


    @GetMapping("/{userIds}")
    public R<Map<Long, String>> getUserInfo(@PathVariable("userIds") List<Long> userIds) {
        Map<Long, String> longStringMap = remoteUserService.selectNickNameByIds(userIds);
        return R.ok(longStringMap);
    }
}
